package com.shopping.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.shopping.dao.CartDao;
import com.shopping.po.Cart;
import com.shopping.service.CartService;


@Service
@Transactional
public class CartServiceImpl implements CartService {
	@Autowired
	private CartDao cartDao;
	public void inserCart(Cart cart) {
		cartDao.inserCart(cart);
	}
	public List<Cart> selectCartbyStock_id(Integer stock_id,Integer user_id) {
		return cartDao.selectCartbyStock_id(stock_id,user_id);
	}
	public List<Cart> selectCartByUser(Integer user_id){
		return cartDao.selectCartByUser(user_id);
	}
	public void deleteCartById(Integer cart_id) {
		cartDao.deleteCartById(cart_id);
	}
}
